import request from '@/utils/request.js'

// 文章分类
export function myCateList () {
  return request({
    url: '/my/cate/list'
  })
}
// 新增分类
export function myCateAdd (data) {
  return request({
    url: '/my/cate/add',
    method: 'post',
    data
  })
}
// 修改分类
export function myCateInfoPut (data) {
  return request({
    url: '/my/cate/info',
    method: 'put',
    data
  })
}

// 删除
export function myCateDel (id) {
  return request({
    url: '/my/cate/del',
    method: 'delete',
    // delete的参数是类似get传参,params
    // post put patch data传参(body)
    params: {
      id
    }
  })
}
// 查询 文章列表
export function myArticleList (params) {
  return request({
    url: '/my/article/list',
    params
  })
}

// 发布文章
export function myArticleAdd (data) {
  return request({
    url: '/my/article/add',
    method: 'post',
    data
  })
}

// 删除文章
export function myArticleInfoDelete (id) {
  return request({
    url: '/my/article/info',
    method: 'delete',
    params: {
      id
    }
  })
}
